package foundation.yang_hui_triangle;

import java.util.Scanner;

/**
 * 杨辉三角
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] res = new int[n][n];
        if (n == 0) {
            return;
        }
        if (n == 1) {
            System.out.println(1);
            return;
        }
        res[0][0] = res[1][0] = res[1][1] = 1;
        for (int i = 2; i < n; i++) {
            res[i][0] = 1;
            for (int j = 1; j < i; j++) {
                res[i][j] = res[i - 1][j - 1] + res[i - 1][j];
            }
            res[i][i] = 1;
        }
        for (int i = 0; i < n; i++) {
            for (int j = 0; j <= i; j++) {
                System.out.print(res[i][j]);
                if (j != i) {
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}
